package com.yonyou.pmclouds.im.rmiimpl;

import com.yonyou.pmclouds.basecom.bp.processor.AuditInfoInsertProcessor;
import com.yonyou.pmclouds.basecom.bp.template.SingleInsertBpTemplate;
import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.im.entity.IMPushLogVO;
import com.yonyou.pmclouds.im.mapper.IMPushLogMapper;
import com.yonyou.pmclouds.im.service.IMPushLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class IMPushLogServiceImpl implements IMPushLogService {

    @Autowired
    private IMPushLogMapper mapper;

    @Override
    public IMPushLogVO addIMPushLog(IMPushLogVO logVO) throws BusinessException{

        SingleInsertBpTemplate bp = new SingleInsertBpTemplate<IMPushLogVO>(mapper);
        bp.addBeforeProcessor(new AuditInfoInsertProcessor());
        bp.insert(logVO);

        return logVO;
    }
}
